package android.FiltrosJava;

public class Vanish extends PointFilter{
	protected int vR, vG, vB;
	protected float p;
	public Vanish(int R, int G, int B, float transparency){
		setVanish(R, G, B, transparency);				
	}
	public void setVanish(int R, int G, int B, float transparency){
		vR = R;
		vG = G;
		vB = B;
		p = transparency;
	}
	
	public int[] computeFilter(int px, int py, int[] imageData){
		imageData[0] = (int) (p * imageData[0] + (1 - p) * vR);	
		imageData[1] = (int) (p * imageData[1] + (1 - p) * vG);
		imageData[2] = (int) (p * imageData[2] + (1 - p) * vB);
		
		return imageData;
	}
	@Override
	public int[] applyFilter(int[] pixels) {
		// TODO Auto-generated method stub
		return null;
	}
}